import { url } from "@/api/url"
import axios from 'axios'

import request from '@/utils/request'

export function listPlugin(query) {
    return request({
        url: url + '/plugin/list',
        method: 'get',
        params: query
    })
}

export function addPlugin(param) {
    return request({
        url: url + '/plugin/add',
        method: 'post',
        data: param
    })
}

export function deletePlugin(param) {
    return request({
        url: url + '/plugin/delete',
        method: 'post',
        data: { "uuids": param }
    })
}

export function updatePlugin(param) {
    return request({
        url: url + '/plugin/update',
        method: 'post',
        data: param
    })
}

export function downloadPluginFile(uuid) {
    window.location.href=url+"/plugin/download?uuid="+uuid;
}

export function asyncPlugin(param) {
    return request({
        url: url + '/plugin/asyncById',
        method: 'get',
        params: param
    })
}